package summer_vacation.xuqianlan;

/**
 * Created by lenovo on 2015/9/2.
 */
public class Test_6 {
    public static void main(String[] args) {
        double sum = 0;
        double n;
        for(n=1;;n++){
            sum+=1/n;
            if(sum>5.0){
                break;
            }
        }
        System.out.println("n is "+n+" sum ="+sum);
    }
}
